<?
class adminActionHandler extends ActionHandler
{
    private $_user;
    private $_dbLink;
    private $_module;
    private $_aLog;

    // helper para upload
    function __construct()
    {
        $this->setup();
        parent::__construct();
    }

    function setup($vars=array())
    {
        global $user;
        global $dbLink;
        global $module;
        global $aLog;
        $this->_user = $vars['user']? $vars['user'] : $user;
        $this->_dbLink = $vars['dbLink']? $vars['dbLink'] : $dbLink;
        $this->_module = $vars['module']? $vars['module'] : $module;
        $this->_aLog = $vars['aLog']? $vars['aLog'] : $aLog;
    }

    function isEnabledTo($action, &$message)
    {
        if (!$this->_user->isEnabledTo($action, $this->module->id))
        {
            $this->message = $lang->translate("user_action_denied");
            return 0;
        }
        return 1;
    }
}

?>
